package rttest;

public class NativeHelper {

	static
	{
		System.loadLibrary("nativehelper");
		if(!sched_setscheduler_FIFO(0)) throw new SecurityException();
	}
	
	private static native int getMinRTPriority_FIFO();
	private static native int getMaxRTPriority_FIFO();
	//private static native int nanosleep0(long nanoseconds);	
	private static native boolean sched_setscheduler_FIFO(int pid);
	
	private static int minRTPriority_FIFO = getMinRTPriority_FIFO();
	private static int maxRTPriority_FIFO = getMaxRTPriority_FIFO();
	
	//public static native boolean sched_setaffinity(int pid, BitSet mask);
	//public static native int setpriority(int tid, int prio);
	public static native int gettid();
	/*
	public static int getMinRTPriority()
	{
		return minRTPriority_FIFO;
	}
	public static int getMaxRTPriority()
	{
		return maxRTPriority_FIFO;
	}
	public static void nanosleep(long nanoseconds) throws InterruptedException
	{
		int result = nanosleep0(nanoseconds);
		if(result != 0) throw new InterruptedException();		
	}
	*/
}
